import request from '@/utils/request';

// 获取员工分页列表
export const getStaffManagePageList = (data) => {
  return request({
    url: '/personnelManagement/employees/getAllEmployees',
    method: 'POST',
    data,
  });
};

// 删除员工
export const deleteStaffReq = (data) => {
  return request({
    url: `/personnelManagement/employees/deleteById`,
    method: 'POST',
    data,
  });
};

// 入职报道填写
export const joinOffer = () => {
  return request({
    url: '/personnelManagement/employees/fillInOnboardingRegistrationInformation',
    method: 'POST',
  });
};

// 入职情况分页列表
export const getOfferPageListReq = (data) => {
  return request({
    url: '/personnelManagement/employees/viewTheStatusOfFillingOutTheOnboardingLink',
    method: 'POST',
    data,
  });
};

// 失效链接
export const loseLinkReq = (data) => {
  return request({
    url: '/personnelManagement/employees/brokenLink',
    method: 'POST',
    data,
  });
};

// 获取员工入职填写表单
export const getStaffFormDetailReq = (data) => {
  return request({
    url: '/personnelManagement/employees/viewOnboardingForm',
    method: 'POST',
    data,
  });
};

// 回显员工数据
export const getStaffDetailReq = (data) => {
  return request({
    url: '/personnelManagement/employees/viewEmployeeDetails',
    method: 'POST',
    data,
  });
};

// 修改员工数据
export const updateStaffReq = (data) => {
  return request({
    url: '/personnelManagement/employees/updateEmployeeDetails',
    method: 'POST',
    data,
  });
};

// 入职表单审批

export const handleFormSubmissionReq = (data) => {
  return request({
    url: '/personnelManagement/employees/handleFormSubmission',
    method: 'POST',
    data,
  });
};

// 根据部门插刚问
export const getPostByDepId = (data) => {
  return request({
    url: '/personnelManagement/departments/obtainJobPositionsByDepartmentId',
    method: 'POST',
    data,
  });
};
